package com.cooper.dao.item;

import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.Insert;
import net.paoding.rose.jade.annotation.ReturnGeneratedKeys;
import net.paoding.rose.jade.annotation.SQL;

import com.cooper.entity.ItemPropImage;

@DAO
public interface ItemPropImageDAO {

	static final String TABLE_NAME = "d_item_prop_image";
	
	@ReturnGeneratedKeys
	@Insert(tableName=TABLE_NAME)
	Long saveEntity(ItemPropImage itemPropImage) throws Exception;
	
	@Insert(tableName=TABLE_NAME)
	void saveEntities(List<ItemPropImage> itemPropImageList) throws Exception;
	
	@SQL("select * from d_item_prop_image t where t.id=:1 ")
	ItemPropImage loadById(long id) throws Exception;
	
	@SQL("update d_item_prop_image set main_url=:1.mainUrl,gallery_url=:1.galleryUrl,thumb_url=:1.thumbUrl "
			+ "where id = :1.id ")
	int updateImageThumb(ItemPropImage itemPropImage) throws Exception;
	
}
